<?php

namespace App\Cms\Controller;

class Contact extends Base {

    public function index() {
        
        if ($this->request->isPost()) {

            $data = $this->request->get();

            $result = Cms()->Comment()->add($data);

            if ($result) {
                succ('您的留言我们已经收到，感谢您对我们的关注和支持！');
            } else {
                fail('留言发送失败');
            }
        }
        
        $this->current_nav_id = 'contact';
        
        $this->title = '联系建议';
        
    }

}
